﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Castle.ActiveRecord;
using ZDSoft.UPMS.Model.SystemPart;

namespace ZDSoft.UPMS.Model.BusinessPart
{
    /// <summary>
    /// 课程类
    /// </summary>
    /// Author：刘祖民
    /// CreateTime:2013-5-22

    [ActiveRecord]
    public class Course : ModelBase<Course>
    {
        /// <summary>
        /// 课程名
        /// </summary>
        [Property]
        public string Name { get; set; }
        /// <summary>
        /// 状态
        /// </summary>
        [Property]
        public bool IsActive { get; set; }

        /// <summary>
        /// 课时
        /// </summary>
        [Property]
        public int lesson { get; set; }


        [BelongsTo("TermID")]
        public Term Term { get; set; }

        [HasMany(typeof(Score), ColumnKey = "CourseID")]
        public IList<Score> Scores { get; set; }


        /// <summary>
        /// 布置作业次数
        /// </summary>
        [Property]
        public int WorkTiems { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [Property]
        public string Remark { get; set; }

        //[HasMany(typeof(Score), ColumnKey = "CourseID")]
        //public IList<Score> Scores { get; set; }

        /// <summary>
        /// 教师所上课程
        /// </summary>

        [HasMany(typeof(TeacherTeachingCourse), ColumnKey = "CourseID", Inverse = true)]
        public IList<TeacherTeachingCourse> TeacherTeachingCourses { get; set; }
    }
}
